package com.example.mapinformationandroid.DataBase;

import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class BaseDBHelper extends SQLiteOpenHelper {

    public static final String db_name = "Map.db";
    private static final int DATABASE_VERSION = 1 ;

    public BaseDBHelper(Context context,int version){
        super(context, db_name, null, version);
    }

    public BaseDBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    public BaseDBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version, @Nullable DatabaseErrorHandler errorHandler) {
        super(context, name, factory, version, errorHandler);
    }



    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.i("TAG:","创建person数据库表！");
        db.execSQL("CREATE TABLE IF NOT EXISTS userTB( id INTEGER PRIMARY KEY AUTOINCREMENT," +
                "name String," +
                "head_picture Text,"+
                "phone Text,"+
                "examine INTEGER," +
                "support INTEGER," +
                "token Text)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
